﻿<phone:PhoneApplicationPage
    x:Class="SampleResizebleItem.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:Control="clr-namespace:SampleResizebleItem.Controls"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="False">

    <phone:PhoneApplicationPage.Resources>
        <Style x:Key="TileBase" TargetType="Rectangle">
            <Setter Property="Fill" Value="{StaticResource PhoneAccentBrush}"/>
            <Setter Property="Margin" Value="12,0,0,12"/>
        </Style>

        <Style x:Key="TileSmall" TargetType="Rectangle" BasedOn="{StaticResource TileBase}"/>

        <Style x:Key="TileMedium" TargetType="Rectangle" BasedOn="{StaticResource TileBase}">
            <Setter Property="Control:VariableSizedWrapGrid.RowSpan" Value="2"/>
            <Setter Property="Control:VariableSizedWrapGrid.ColumnSpan" Value="2"/>
        </Style>

        <Style x:Key="TileLarge" TargetType="Rectangle" BasedOn="{StaticResource TileBase}">
            <Setter Property="Control:VariableSizedWrapGrid.RowSpan" Value="2"/>
            <Setter Property="Control:VariableSizedWrapGrid.ColumnSpan" Value="4"/>
        </Style>
    </phone:PhoneApplicationPage.Resources>
    
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <ScrollViewer>
            <Control:VariableSizedWrapGrid x:Name="variableSizedWrapGrid"  
                                           ItemWidth="95" ItemHeight="95" 
                                           MaximumRowsOrColumns="5" Orientation="Horizontal" 
                                           Margin="0,0,1,0" />  
        </ScrollViewer>
    </Grid>

</phone:PhoneApplicationPage>